class Solution {
public:
    void moveZeroes(vector<int>& nums) {
        int first=1;
        int slow=0;
        while(first<=nums.size()-1)
        {
            if(nums[slow]==0&&nums[first]!=0)
            {
                swap(nums[slow],nums[first]);
            }
            if(nums[slow]==0)
            {
                ++first;
            }
            else
            {
                ++first;
                ++slow;
            }
        }
    
    }
};
